<?php 
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: show.phtml 5373 2010-09-10 02:22:07Z huuphuoc $
 * @since		2.0.9
 */
?>
<?php if ($this->article) : ?>
    <?php if ($this->showArticleOnMainSite): ?>
        <div class="image">
                <?php if ($this->article->image_crop != null) : ?>
                <a href="<?php echo $this->url($this->article->getProperties(), 'news_article_details'); ?>">
                        <img src="<?php echo $this->article->image_crop; ?>" />
                </a>
                <?php endif; ?>
        </div>
        <h2><?php echo $this->article->title; ?></h2>
        <div>
            <div><?php echo $this->article->description; ?></div>
        </div>
        <div>
            <div><?php echo $this->article->content; ?></div>
        </div>
    <?php else: ?>
        <div class="t_news_article">
                <div class="image">
                        <?php if ($this->article->image_crop != null) : ?>
                        <a href="<?php echo $this->url($this->article->getProperties(), 'news_article_details'); ?>">
                                <img src="<?php echo $this->article->image_crop; ?>" />
                        </a>
                        <?php endif; ?>
                </div>

                <h2><a href="<?php echo $this->url($this->article->getProperties(), 'news_article_details'); ?>"><?php echo $this->article->title; ?></a></h2>
                <cite><?php echo $this->article->created_date; ?></cite>
                <div><?php echo $this->article->description; ?></div>
        </div>
        <?php if (!empty($this->article->attachment)): ?>
        <div class="attachments">
            <p class="attachments_title">
            <?php if (strstr('/', $this->article->attachment)) { 
                $name = explode('/', $this->article->attachment);
            }
            else {
                $name = explode('\\', $this->article->attachment);
            }

            $name = end($name);
            echo $this->translator('article_download_attachment'). ': ';	
            ?>
            </p>
            <p class="attachments_file"><a href="/download.php?file=<?php echo base64_encode($this->article->attachment); ?>"><?php echo $name; ?></a></p>
        </div>
        <?php endif; ?>
    <?php endif; ?>
<?php endif; ?>
